{% extends 'wxchat/wxbase.html' %}{% load static %}

{% block extra %}
<script>
        $(function () {
            $('#id_province').on('click', function (e) {
                target = e.target;
               $(target).attr("readOnly","true");
                getDataList("/static/wxchat/js/areacode.json");
            });

        });
    function getDataList(url){
        $.ajax({
          type: 'GET',
          url: url,
          dataType: 'json',
          timeout: 5000,
          success: function(data){
             weui.picker(data, {
                    depth: 3,
                    defaultValue: ['21', '2114', '211402'],
                    onChange: function (result) {
                        $(target).val(result[0].label + ' ' + result[1].label + ' ' + result[2].label );

                    },
                    onConfirm: function (result) {
                        $(target).val(result[0].label + ' ' + result[1].label + ' ' + result[2].label );
                    },
                    id: 'cascadePicker'
                });
          },
          error: function(xhr, type,error){
              console.log(type);
          }
        });
    }
    </script>
<script type="application/javascript">
 window.history.forward(1);
</script>

{% endblock extra%}

{% block container %}
<div class="weui-cells__title">加盟宠物医疗机构登记表1<span class="r"><a href="{% url 'dog-index' %}"><i class="fa fa-home fa-lg green" aria-hidden="true"></i></a><span></div>
<form action="" method="post" enctype="multipart/form-data" onsubmit="showing()">{% csrf_token %}
<div class="weui-cells weui-cells_form" id="uploader">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">{{ form.name.label }}:</label></div>
        <div class="weui-cell__bd">
            {{ form.name }}
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd">
            <label for="" class="weui-label">{{ form.province.label }}:</label>
        </div>
        <div class="weui-cell__bd">
              {{ form.province }}
        </div>
    </div>
{#    <div class="weui-cell">#}
{#        <div class="weui-cell__hd"><label for="" class="weui-label">{{ form.city.label }}:</label></div>#}
{#        <div class="weui-cell__bd">#}
{#            {{ form.city }}#}
{#        </div>#}
{#    </div>#}
    <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">{{ form.address.label }}:</label></div>
        <div class="weui-cell__bd">
            {{ form.address }}
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label for="" class="weui-label">{{ form.tel.label }}:</label></div>
        <div class="weui-cell__bd">
            {{ form.tel }}
        </div>
    </div>
    <div class="weui-btn-area">
        <button type="submit" name="submit" class="weui-btn weui-btn_primary" >提交</button>
    </div>
</div>
</form>

{% endblock container %}


